package org.dding.msc.service;

import org.dding.msc.services.HttpServerService;
import org.junit.Test;

public class ServiceContainerInitTestCase {

	protected volatile ServiceContainer serviceContainer;
	private static final ServiceName firstServiceName = ServiceName
			.of("firstService");

	@Test
	public void containerSetup() throws InterruptedException {
		serviceContainer = MSCFactory.create();
		final ServiceController<?> firstController = serviceContainer
				.addService(firstServiceName, new HttpServerService()).install();
		Thread.sleep(3000);
//		serviceContainer.dumpServices();
		System.out.println(firstController.getState());
//	    serviceContainer.shutdown();
//	    Thread thread = new Thread(new Runnable() {
//
//			@Override
//			public void run() {
//				while (true) {
//					try {
//						Thread.sleep(5000);
//					} catch (InterruptedException e) {
//						// TODO Auto-generated catch block
//						e.printStackTrace();
//					}
//					System.out.println(firstController.getState());
//				}
//
//			}
//		});
//		thread.start();
//        serviceContainer.awaitTermination();
      
	}
}
